package com.zidian.leader.activity;

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

import com.zidian.leader.R;
import com.zidian.leader.common.activity.MySwipeBackActivity;

import butterknife.Bind;

/**
 * 关于Activity
 * Created by GongCheng on 2017/2/20.
 */

public class AboutActivity extends MySwipeBackActivity {
    @Bind(R.id.about_tv)
    TextView aboutTv;
    @Bind(R.id.version_code_tv)
    TextView versionCodeTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_about;
    }

    private void initView() {
        actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back_24dp);
        actionBar.setTitle(R.string.about);
        String versionName;
        try {
            versionName = this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName;
            versionCodeTv.setText(getString(R.string.version, versionName));
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        aboutTv.setText(R.string.about_zidian);
    }
}
